package com.zzyl.service.impl;

import com.github.pagehelper.PageHelper;
import com.zzyl.base.PageBean;
import com.zzyl.dto.DeviceDataPageReqDto;
import com.zzyl.mapper.DeviceDataMapper;
import com.zzyl.service.DeviceDataService;
import com.zzyl.vo.DeviceDataVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class DeviceDataServiceImpl implements DeviceDataService {

    @Autowired
    private DeviceDataMapper deviceDataMapper;

    @Override
    public PageBean<DeviceDataVo> getPage(DeviceDataPageReqDto dto) {
        PageHelper.startPage(dto.getPageNum(), dto.getPageSize());
        return PageBean.of(deviceDataMapper.selectByPage(dto), DeviceDataVo.class);
    }
}
